Mobile devices often provide multimedia functionality. Because of their size, static and moving digital images and sound files (among other types of data files) are commonly stored on data storage media cards usually employing flash memory (and accordingly sometimes referred to as flash memory cards) or other non-volatile data storage that can be electrically erased and reprogrammed. Occasionally, the user of the mobile device will want to remove the media card. This may be because the user wants to replace it with another media card having more available storage space. Alternatively, the user may simply want to transfer the media card to another electronic device to access or duplicate the stored data files. As discussed below, the untimely removal of a media card may result in the loss of the data stored on the card.
In most instances, such media cards are formatted with a FAT (file allocation table) file system. Given the ubiquitous nature of FAT file systems, this ensures interoperability with a wide range of systems and devices. A file allocation table stores organizational data indicating, among other things, sector addresses where different segments of each data file are stored on the media card.
An inherent weakness of the FAT file system is that a data sector can only be modified with a “read-modify-erase-write” operation. As a result, a catastrophic event (such as a power loss, or untimely removal of the media card) during an update of the allocation table could result in the entire allocation table being lost. In such a circumstance, the operating system would be unable to locate and hence access the data in the data files, despite the fact that such data would likely still exist.
A backup copy of the allocation table may be used to mitigate against such data loss, but various implementations of FAT file systems either utilize such a backup either inconsistently or not at all. Further, some flash memory devices may store both copies of the allocation table in the same sector, thereby risking loss of both copies simultaneously.
Similarly, the directory entries stored on the media card are also at risk, and are scattered throughout the disk. These entries do not benefit from the FAT redundancy (which as mentioned is inconsistently used).
It is desired to address or ameliorate one or more shortcomings or disadvantages associated with existing ways of removing a media card from a mobile device, or to at least provide a useful alternative to such ways.